Carbon introduces substantial changes to the printing model. The original Printing Manager defined in Printing.h is replaced by a new Carbon Printing Manager defined in PMApplication.h. The Carbon Printing Manager allows applications to print on Mac OS 8 with existing printer drivers and on Mac OS X with new printer drivers.
The following is a summary of the major changes you need to be aware of. More information is available on the Carbon website: <http://developer.apple.com/macosx/carbon/>
* The Print Record (TPrint) is no longer directly accessible by applications, and has been split into two separate opaque objects: a PrintSettings object and a PageFormat object. Applications will be given references to these two privately-defined data structures. These references are then used to query the Printing Manager for information contained within the objects.
* A consequence of splitting the Print Record and making it private is there are no fixed sizes. Applications will be able to "extend" both the PrintSettings and PageFormat objects, but applications must not assume a specific size when storing and retrieving a PageFormat with documents.
* The Printing Manager will supply functions for flattening and restoring both the PrintSettings and PageFormat object. When storing printing information with documents it will suffice to store just the PageFormat object. If older versions of your application store a print record with a saved document, you may continue to do so to provide backward compatibility.
* Application developers should reduce the use of calls that append items to print dialogs. We expect to provide a new panel-based interface in the near future.
* All print records use the "draft" style, not the "deferred" style, which implies that a print driver must handle the spooling if it wants to provide spooling for the user. Many, if not all, print drivers perform their own spooling and don't require applications to call PrPicFile() to implement spooling. Because it is rarely used, we are eliminating system level spooling code from the Printing Manager.
* The Printing Manager will now enforce an order in which some routines are called. Any routine used out of scope will return an error.
* All Printing Manager routines are only valid within a PMBegin/PMEnd block.
* PrintSettings and PageFormats are automatically disposed of during a PMEnd call.
* The desktop printing functions defined in DesktopPrinting.h are not supported in Carbon.
CallDTPAsyncErrorNotificationProc
DisposeDTPAsyncErrorNotificationUPP
DTPAsyncErrorNotificationProcPtr
InvokeDTPAsyncErrorNotificationUPP
NewDTPAsyncErrorNotificationProc
NewDTPAsyncErrorNotificationUPP
Replace PrClose withPMEnd .Replace PrCloseDoc withPMEndDocument .Replace PrClosePage withPMEndPage .Use the Carbon Printing Manager functions to send print requests to the printer driver.Replace PrDlgMain with a call toPMPrintDialogMain for a job dialog box or a call toPMPageSetUpDialogMain
for a style dialog box.Carbon applications must use Carbon Printing Manager functions instead.Carbon applications must use Carbon Printing Manager functions instead.To send various print requests to the printer driver, use the higher-level Carbon Printing Manager functions instead.Replace PrError withPMError
.Replace PrGeneral withPMGeneral .Replace PrintDefault with calls toPMDefaultPageFormat andPMDefaultPrintSettings
.Replace PrJobDialog withPMPrintDialog .Replace PrJobInit withPMPrintDialogInit .Replace PrOpen withPMBegin. Replace PrOpenDoc withPMBeginDocument .Replace PrOpenPage withPMBeginPage .This function is obsolete. Printer drivers must perform their own spooling.Replace PrSetError withPMSetError .Replace PrStlDialog withPMPageSetUpDialog .Replace PrStlInit withPMPageSetUpDialogInit .Replace PrValidate with calls toPMValidatePageFormat andPMValidatePrintSettings
.